3.1104 \(\int \frac{\sqrt{c+d \tan (e+f x)}}{a+i a \tan (e+f x)} \, dx\)

Optimal. Leaf size=140 \[ \frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}-\frac{i \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d}}\right )}{2 a f}+\frac{i c \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c+i d}}\right )}{2 a f \sqrt{c+i d}} \]

[Out]

((-I/2)*Sqrt[c - I*d]*ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqrt[c - I*d]])/(a*f) + ((I/2)*c*ArcTanh[Sqrt[c + d*Tan
[e + f*x]]/Sqrt[c + I*d]])/(a*Sqrt[c + I*d]*f) + ((I/2)*Sqrt[c + d*Tan[e + f*x]])/(f*(a + I*a*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.359924, antiderivative size = 140, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.167, Rules used = {3549, 3539, 3537, 63, 208} \[ \frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}-\frac{i \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d}}\right )}{2 a f}+\frac{i c \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c+i d}}\right )}{2 a f \sqrt{c+i d}} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[c + d*Tan[e + f*x]]/(a + I*a*Tan[e + f*x]),x]

[Out]

((-I/2)*Sqrt[c - I*d]*ArcTanh[Sqrt[c + d*Tan[e + f*x]]/Sqrt[c - I*d]])/(a*f) + ((I/2)*c*ArcTanh[Sqrt[c + d*Tan
[e + f*x]]/Sqrt[c + I*d]])/(a*Sqrt[c + I*d]*f) + ((I/2)*Sqrt[c + d*Tan[e + f*x]])/(f*(a + I*a*Tan[e + f*x]))

Rule 3549

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[((
a*c + b*d)*(c + d*Tan[e + f*x])^n)/(2*(b*c - a*d)*f*(a + b*Tan[e + f*x])), x] + Dist[1/(2*a*(b*c - a*d)), Int[
(c + d*Tan[e + f*x])^(n - 1)*Simp[a*c*d*(n - 1) + b*c^2 + b*d^2*n - d*(b*c - a*d)*(n - 1)*Tan[e + f*x], x], x]
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && LtQ[0,
n, 1]

Rule 3539

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c
 + I*d)/2, Int[(a + b*Tan[e + f*x])^m*(1 - I*Tan[e + f*x]), x], x] + Dist[(c - I*d)/2, Int[(a + b*Tan[e + f*x]
)^m*(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0]
&& NeQ[c^2 + d^2, 0] &&  !IntegerQ[m]

Rule 3537

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(c*
d)/f, Subst[Int[(a + (b*x)/d)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] &&
NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 208

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-(a/b), 2]*ArcTanh[x/Rt[-(a/b), 2]])/a, x] /; FreeQ[{a,
b}, x] && NegQ[a/b]

Rubi steps

\begin{align*} \int \frac{\sqrt{c+d \tan (e+f x)}}{a+i a \tan (e+f x)} \, dx &=\frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}+\frac{\int \frac{\frac{1}{2} a (c+i d) (2 i c+d)+\frac{1}{2} a (i c-d) d \tan (e+f x)}{\sqrt{c+d \tan (e+f x)}} \, dx}{2 a^2 (i c-d)}\\ &=\frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}+\frac{c \int \frac{1-i \tan (e+f x)}{\sqrt{c+d \tan (e+f x)}} \, dx}{4 a}+\frac{(c-i d) \int \frac{1+i \tan (e+f x)}{\sqrt{c+d \tan (e+f x)}} \, dx}{4 a}\\ &=\frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}-\frac{(i c) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{4 a f}+\frac{(i c+d) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{c-i d x}} \, dx,x,i \tan (e+f x)\right )}{4 a f}\\ &=\frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}-\frac{c \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i c}{d}-\frac{i x^2}{d}} \, dx,x,\sqrt{c+d \tan (e+f x)}\right )}{2 a d f}-\frac{(c-i d) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i c}{d}+\frac{i x^2}{d}} \, dx,x,\sqrt{c+d \tan (e+f x)}\right )}{2 a d f}\\ &=-\frac{i \sqrt{c-i d} \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c-i d}}\right )}{2 a f}+\frac{i c \tanh ^{-1}\left (\frac{\sqrt{c+d \tan (e+f x)}}{\sqrt{c+i d}}\right )}{2 a \sqrt{c+i d} f}+\frac{i \sqrt{c+d \tan (e+f x)}}{2 f (a+i a \tan (e+f x))}\\ \end{align*}

Mathematica [B]  time = 4.72949, size = 339, normalized size = 2.42 \[ \frac{\sec (e+f x) (\cos (f x)+i \sin (f x)) \left (2 \cos (e+f x) (\sin (f x)+i \cos (f x)) \sqrt{c+d \tan (e+f x)}-i (\cos (e)+i \sin (e)) \left (\sqrt{c-i d} \log \left (\frac{2 \left (\sqrt{c-i d} \left (1+e^{2 i (e+f x)}\right ) \sqrt{c-\frac{i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}+c \left (1+e^{2 i (e+f x)}\right )-i d e^{2 i (e+f x)}\right )}{\sqrt{c-i d}}\right )-\frac{c \log \left (\frac{8 i e^{-2 i f x} \left (\sqrt{c+i d} \left (1+e^{2 i (e+f x)}\right ) \sqrt{c-\frac{i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}+c \left (1+e^{2 i (e+f x)}\right )+i d\right )}{c \sqrt{c+i d}}\right )}{\sqrt{c+i d}}\right )\right )}{4 f (a+i a \tan (e+f x))} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[c + d*Tan[e + f*x]]/(a + I*a*Tan[e + f*x]),x]

[Out]

(Sec[e + f*x]*(Cos[f*x] + I*Sin[f*x])*((-I)*(Sqrt[c - I*d]*Log[(2*((-I)*d*E^((2*I)*(e + f*x)) + c*(1 + E^((2*I
)*(e + f*x))) + Sqrt[c - I*d]*(1 + E^((2*I)*(e + f*x)))*Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I
)*(e + f*x)))]))/Sqrt[c - I*d]] - (c*Log[((8*I)*(I*d + c*(1 + E^((2*I)*(e + f*x))) + Sqrt[c + I*d]*(1 + E^((2*
I)*(e + f*x)))*Sqrt[c - (I*d*(-1 + E^((2*I)*(e + f*x))))/(1 + E^((2*I)*(e + f*x)))]))/(c*Sqrt[c + I*d]*E^((2*I
)*f*x))])/Sqrt[c + I*d])*(Cos[e] + I*Sin[e]) + 2*Cos[e + f*x]*(I*Cos[f*x] + Sin[f*x])*Sqrt[c + d*Tan[e + f*x]]
))/(4*f*(a + I*a*Tan[e + f*x]))

________________________________________________________________________________________

Maple [A]  time = 0.082, size = 125, normalized size = 0.9 \begin{align*}{\frac{-{\frac{i}{2}}}{af}\sqrt{id-c}\arctan \left ({\sqrt{c+d\tan \left ( fx+e \right ) }{\frac{1}{\sqrt{id-c}}}} \right ) }+{\frac{d}{2\,af \left ( -id+d\tan \left ( fx+e \right ) \right ) }\sqrt{c+d\tan \left ( fx+e \right ) }}-{\frac{{\frac{i}{2}}c}{af}\arctan \left ({\sqrt{c+d\tan \left ( fx+e \right ) }{\frac{1}{\sqrt{-id-c}}}} \right ){\frac{1}{\sqrt{-id-c}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^(1/2)/(a+I*a*tan(f*x+e)),x)

[Out]

-1/2*I/f/a*(I*d-c)^(1/2)*arctan((c+d*tan(f*x+e))^(1/2)/(I*d-c)^(1/2))+1/2/f/a*d*(c+d*tan(f*x+e))^(1/2)/(-I*d+d
*tan(f*x+e))-1/2*I/f/a*c/(-I*d-c)^(1/2)*arctan((c+d*tan(f*x+e))^(1/2)/(-I*d-c)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^(1/2)/(a+I*a*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [B]  time = 2.50273, size = 1808, normalized size = 12.91 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^(1/2)/(a+I*a*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/8*(a*f*sqrt(-(c - I*d)/(a^2*f^2))*e^(2*I*f*x + 2*I*e)*log(1/2*((4*I*a*f*e^(2*I*f*x + 2*I*e) + 4*I*a*f)*sqrt(
((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*sqrt(-(c - I*d)/(a^2*f^2)) + 4*(c - I*d)*
e^(2*I*f*x + 2*I*e) + 4*c)*e^(-2*I*f*x - 2*I*e)) - a*f*sqrt(-(c - I*d)/(a^2*f^2))*e^(2*I*f*x + 2*I*e)*log(1/2*
((-4*I*a*f*e^(2*I*f*x + 2*I*e) - 4*I*a*f)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e)
+ 1))*sqrt(-(c - I*d)/(a^2*f^2)) + 4*(c - I*d)*e^(2*I*f*x + 2*I*e) + 4*c)*e^(-2*I*f*x - 2*I*e)) + 2*a*f*sqrt(-
1/4*I*c^2/((I*a^2*c - a^2*d)*f^2))*e^(2*I*f*x + 2*I*e)*log(-1/2*(c^2*e^(2*I*f*x + 2*I*e) + c^2 + I*c*d - 2*((I
*a*c - a*d)*f*e^(2*I*f*x + 2*I*e) + (I*a*c - a*d)*f)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*
x + 2*I*e) + 1))*sqrt(-1/4*I*c^2/((I*a^2*c - a^2*d)*f^2)))*e^(-2*I*f*x - 2*I*e)/((I*a*c - a*d)*f)) - 2*a*f*sqr
t(-1/4*I*c^2/((I*a^2*c - a^2*d)*f^2))*e^(2*I*f*x + 2*I*e)*log(-1/2*(c^2*e^(2*I*f*x + 2*I*e) + c^2 + I*c*d - 2*
((-I*a*c + a*d)*f*e^(2*I*f*x + 2*I*e) + (-I*a*c + a*d)*f)*sqrt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2
*I*f*x + 2*I*e) + 1))*sqrt(-1/4*I*c^2/((I*a^2*c - a^2*d)*f^2)))*e^(-2*I*f*x - 2*I*e)/((I*a*c - a*d)*f)) + 2*sq
rt(((c - I*d)*e^(2*I*f*x + 2*I*e) + c + I*d)/(e^(2*I*f*x + 2*I*e) + 1))*(I*e^(2*I*f*x + 2*I*e) + I))*e^(-2*I*f
*x - 2*I*e)/(a*f)

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**(1/2)/(a+I*a*tan(f*x+e)),x)

[Out]

Exception raised: AttributeError

________________________________________________________________________________________

Giac [B]  time = 1.54771, size = 502, normalized size = 3.59 \begin{align*} \frac{1}{2} \, d^{2}{\left (\frac{\sqrt{2} c \arctan \left (\frac{16 i \, \sqrt{d \tan \left (f x + e\right ) + c} c + 16 i \, \sqrt{c^{2} + d^{2}} \sqrt{d \tan \left (f x + e\right ) + c}}{8 \, \sqrt{2} \sqrt{c + \sqrt{c^{2} + d^{2}}} c + 8 i \, \sqrt{2} \sqrt{c + \sqrt{c^{2} + d^{2}}} d + 8 \, \sqrt{2} \sqrt{c^{2} + d^{2}} \sqrt{c + \sqrt{c^{2} + d^{2}}}}\right )}{a \sqrt{c + \sqrt{c^{2} + d^{2}}} d^{2} f{\left (\frac{i \, d}{c + \sqrt{c^{2} + d^{2}}} + 1\right )}} + \frac{\sqrt{d \tan \left (f x + e\right ) + c}}{{\left (d \tan \left (f x + e\right ) - i \, d\right )} a d f} - \frac{4 \,{\left (-i \, c - d\right )} \arctan \left (\frac{4 \,{\left (\sqrt{d \tan \left (f x + e\right ) + c} c - \sqrt{c^{2} + d^{2}} \sqrt{d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}} - i \, \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}} d - \sqrt{c^{2} + d^{2}} \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}}}\right )}{a \sqrt{-8 \, c + 8 \, \sqrt{c^{2} + d^{2}}} d^{2} f{\left (-\frac{i \, d}{c - \sqrt{c^{2} + d^{2}}} + 1\right )}}\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^(1/2)/(a+I*a*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*d^2*(sqrt(2)*c*arctan((16*I*sqrt(d*tan(f*x + e) + c)*c + 16*I*sqrt(c^2 + d^2)*sqrt(d*tan(f*x + e) + c))/(8
*sqrt(2)*sqrt(c + sqrt(c^2 + d^2))*c + 8*I*sqrt(2)*sqrt(c + sqrt(c^2 + d^2))*d + 8*sqrt(2)*sqrt(c^2 + d^2)*sqr
t(c + sqrt(c^2 + d^2))))/(a*sqrt(c + sqrt(c^2 + d^2))*d^2*f*(I*d/(c + sqrt(c^2 + d^2)) + 1)) + sqrt(d*tan(f*x
+ e) + c)/((d*tan(f*x + e) - I*d)*a*d*f) - 4*(-I*c - d)*arctan(4*(sqrt(d*tan(f*x + e) + c)*c - sqrt(c^2 + d^2)
*sqrt(d*tan(f*x + e) + c))/(c*sqrt(-8*c + 8*sqrt(c^2 + d^2)) - I*sqrt(-8*c + 8*sqrt(c^2 + d^2))*d - sqrt(c^2 +
 d^2)*sqrt(-8*c + 8*sqrt(c^2 + d^2))))/(a*sqrt(-8*c + 8*sqrt(c^2 + d^2))*d^2*f*(-I*d/(c - sqrt(c^2 + d^2)) + 1
)))